import React from 'react';
import {
    Navigator,
    AppRegistry,
} from 'react-native';

//这里列出所有的路由
import Adv from './src/page/AdvScreen';
import Login from './src/page/Login';
import FindPwd from './src/page/FindPwd';
import FindByPhone from './src/page/FindByPhone';
import FindByPhone2 from './src/page/FindByPhone2';
import Register from './src/page/Register';
import RegPhone from './src/page/RegPhone';
import RegPhone2 from './src/page/RegPhone2';
import Main from './src/page/Main';
import Result from './src/page/Result';
import SearchContent from './src/page/SearchContent';
import News from './src/page/News';
import Info from './src/page/Info';
import Content from './src/page/Content';
import Mrzt from './src/page/Mrzt';
import MrztSearch from './src/page/MrztSearch';
import Nc from './src/page/Nc';
import NcSearch from './src/page/NcSearch';
import Portfolio from './src/page/Portfolio';
import PortfolioAdd from './src/page/PortfolioAdd';
import PortfolioManage from './src/page/PortfolioManage';
import Setting from './src/page/Setting';
import MyDetail from './src/page/MyDetail';
import WebContent from './src/page/WebContent';
import MyOpin from './src/page/MyOpin';
import MyOut from './src/page/MyOut';
import ConnectUs from './src/page/ConnectUs';
import MyRule from './src/page/MyRule';
import MySpread from './src/page/MySpread';

class SmztRefector extends React.Component {
    render() {
        return (
            <Navigator
                initialRoute={{id:'AdvScreen',name:'神秘涨停',message:'神秘涨停'}}
                renderScene={this.renderScene}
                configureScene={(route)=>{
                    if (route.sceneConfig){
                        return route.sceneConfig;
                    }
                    return {...Navigator.SceneConfigs.FloatFromRight,gestures:null}
                }}
            />
        );
    }

    renderScene(route, navigator) {
        const routeId = route.id;

        switch (routeId) {
            case 'Test':
                return(
                    <Test navigator={navigator}/>
                );
            case 'AdvScreen'://软件欢迎页
                return (
                    <Adv
                        navigator={navigator}/>
                );
            case 'LoginPage'://登陆页面
                return (
                    <Login
                        message={route.message}
                        navigator={navigator}/>
                );
            case 'FindPwd': //找回密码
                return (
                    <FindPwd
                        message={route.message}
                        navigator={navigator}/>
                );
            case 'FindByPhone':
                return (
                    <FindByPhone
                        message={route.message}
                        navigator={navigator}/>
                );
            case 'FindByPhone2':
                return (
                    <FindByPhone2
                        message={route.message}
                        navigator={navigator}/>
                );
            case 'News':
                return (
                    <News
                        message={route.message}
                        navigator={navigator}/>
                );
            case 'Register'://注册页面
                return (
                    <Register
                        message={route.message}
                        navigator={navigator}/>
                );
            //全局搜索结果页面
            case 'SearchContent':
                return (
                    <SearchContent
                        message={route.message}
                        navigator={navigator}/>
                );
            case 'RegPhone'://手机注册第一页
                return (
                    <RegPhone
                        message={route.message}
                        navigator={navigator}/>
                );
            case 'RegPhone2'://手机注册第二页
                return (
                    <RegPhone2
                        message={route.message}
                        navigator={navigator}/>
                );
            case 'RegQQ'://QQ注册
                return (
                    <RegQQ
                        message={route.message}
                        navigator={navigator}/>
                );
            case 'RegQQ2'://QQ注册
                return (
                    <RegQQ2
                        message={route.message}
                        navigator={navigator}/>
                );
            case 'Main'://软件首页
                return (
                    <Main
                        message={route.message}
                        navigator={navigator}/>
                );
            case 'Content'://资讯详情页
                return (
                    <Content
                        message={route.message}
                        navigator={navigator}/>
                );
            case 'Result'://搜索结果页
                return (
                    <Result
                        message={route.message}
                        navigator={navigator}/>
                );
            case 'WebContent':
                return (
                    <WebContent
                        message={route.message}
                        navigator={navigator}/>
                );
            case 'Mrzt'://每日涨停
                return (
                    <Mrzt
                        message={route.message}
                        navigator={navigator}/>
                );
            case 'MrztSearch'://每日涨停搜索页
                return (
                    <MrztSearch
                        message={route.message}
                        navigator={navigator}/>
                );
            case 'Nc'://内参
                return (
                    <Nc
                        message={route.message}
                        navigator={navigator}/>
                );
            case 'NcSearch'://内参搜索
                return (
                    <NcSearch
                        message={route.message}
                        navigator={navigator}/>
                );
            case 'Info'://资讯页
                return (
                    <Info
                        message={route.message}
                        navigator={navigator}/>
                );
            
            case 'Portfolio'://自选页
                return (
                    <Portfolio
                        message={route.message}
                        navigator={navigator}/>
                );
            case 'PortfolioManage'://自选页
                return (
                    <PortfolioManage
                        message={route.message}
                        navigator={navigator}/>
                );
            case 'PortfolioAdd'://自选页
                return (
                    <PortfolioAdd
                        message={route.message}
                        navigator={navigator}/>
                );
            case 'Setting'://我的
                return (
                    <Setting
                        message={route.message}
                        navigator={navigator}/>
                );
            //我的详情
            case 'MyDetail':
                return (
                    <MyDetail
                        message={route.message}
                        navigator={navigator}/>
                );
            //我的建议  
            case 'MyOpin':
                return (
                    <MyOpin
                        message={route.message}
                        navigator={navigator}/>
                );
            case 'MySpread'://我的推广
                return (
                    <MySpread
                        message={route.message}
                        navigator={navigator}/>
                );
            //免责声明
            case 'MyOut':
                return (
                    <MyOut
                        message={route.message}
                        navigator={navigator}/>
                );
            case 'MyRule'://我的推广
                return (
                    <MyRule
                        message={route.message}
                        navigator={navigator}/>
                );
            case 'ConnectUs':
                return (
                    <ConnectUs
                        message={route.message}
                        navigator={navigator}/>
                );
            default:
                return;

        }
    }
}


AppRegistry.registerComponent('SmztRefector', ()=>SmztRefector);
